<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The Normalizer class</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="locale.setdefault.html">Locale::setDefault</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="normalizer.isnormalized.html">Normalizer::isNormalized</a></div>
 <div class="up"><a href="book.intl.html">intl</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="class.normalizer" class="reference">
 <h1 class="title">The Normalizer class</h1>
 

 <div class="partintro"><p class="verinfo">(PHP 5 &gt;= 5.3.0, PECL intl &gt;= 1.0.0)</p>

  
  <div class="section" id="normalizer.intro">
   <h2 class="title">简介</h2>
   <p class="simpara">
    Normalization is a process that involves transforming characters and
    sequences of characters into a formally-defined underlying representation.
    This process is most important when text needs to be compared for sorting
    and searching, but it is also used when storing text to ensure that the
    text is stored in a consistent representation.
   </p>
   <p class="para">
    The Unicode Consortium has defined a number of normalization forms
    reflecting the various needs of applications:
    <ul class="simplelist">
     <li class="member">Normalization Form D (NFD) - Canonical Decomposition</li>
     <li class="member">
      Normalization Form C (NFC) - Canonical Decomposition followed by
      Canonical Composition
     </li>
     <li class="member">
      Normalization Form KD (NFKD) - Compatibility Decomposition
     </li>
     <li class="member">
      Normalization Form KC (NFKC) - Compatibility Decomposition followed by
      Canonical Composition
     </li>
    </ul>
    The different forms are defined in terms of a set of transformations on
    the text, transformations that are expressed by both an algorithm and a
    set of data files.
   </p>
  </div>
  

  <div class="section" id="normalizer.synopsis">
   <h2 class="title">类摘要</h2>

   
   <div class="classsynopsis">
    <div class="ooclass">
     
    </div>

    
    <div class="classsynopsisinfo">
     <span class="ooclass">
      <strong class="classname">Normalizer</strong>
     </span>
     {</div>
    

    

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="methodsynopsis dc-description">
    <span class="modifier">public</span>
    <span class="modifier">static</span>
    <span class="type">bool</span>
    <span class="methodname"><a href="normalizer.isnormalized.html" class="methodname">isNormalized</a></span>
     ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$input</code></span>
    [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$form</code><span class="initializer"> = Normalizer::FORM_C</span></span>
   ] )</div>
<div class="methodsynopsis dc-description">
    <span class="modifier">public</span>
    <span class="modifier">static</span>
    <span class="type">string</span>
    <span class="methodname"><a href="normalizer.normalize.html" class="methodname">normalize</a></span>
     ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$input</code></span>
    [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$form</code><span class="initializer"> = Normalizer::FORM_C</span></span>
   ] )</div>

   }</div>
   

  </div>

  

  

<div class="section" id="intl.normalizer-constants">
 <h2 class="title">预定义常量</h2>

 <p class="para">
  The following constants define the normalization form used by the
  normalizer:
  <dl>

   
    <dt id="normalizer.constants.form-c">
     <strong><code>Normalizer::FORM_C</code></strong>
     (<span class="type"><a href="language.types.string.html" class="type string">string</a></span>)
    </dt>

    <dd>

     <span class="simpara">
      Normalization Form C (NFC) - Canonical Decomposition followed by
      Canonical Composition
     </span>
    </dd>

   

   
    <dt id="normalizer.constants.form-d">
     <strong><code>Normalizer::FORM_D</code></strong>
     (<span class="type"><a href="language.types.string.html" class="type string">string</a></span>)
    </dt>

    <dd>

     <span class="simpara">Normalization Form D (NFD) - Canonical Decomposition</span>
    </dd>

   

   
    <dt id="normalizer.constants.form-kc">
     <strong><code>Normalizer::FORM_KC</code></strong>
     (<span class="type"><a href="language.types.string.html" class="type string">string</a></span>)
    </dt>

    <dd>

     <span class="simpara">
      Normalization Form KC (NFKC) - Compatibility Decomposition, followed by
      Canonical Composition
     </span>
    </dd>

   

   
    <dt id="normalizer.constants.form-kd">
     <strong><code>Normalizer::FORM_KD</code></strong>
     (<span class="type"><a href="language.types.string.html" class="type string">string</a></span>)
    </dt>

    <dd>

     <span class="simpara">
      Normalization Form KD (NFKD) - Compatibility Decomposition
     </span>
    </dd>

   

   
    <dt id="normalizer.constants.none">
     <strong><code>Normalizer::NONE</code></strong>
     (<span class="type"><a href="language.types.string.html" class="type string">string</a></span>)
    </dt>

    <dd>

     <span class="simpara">No decomposition/composition</span>
    </dd>

   

   
    <dt id="normalizer.constants.option-default">
     <strong><code>Normalizer::OPTION_DEFAULT</code></strong>
     (<span class="type"><a href="language.types.string.html" class="type string">string</a></span>)
    </dt>

    <dd>

     <span class="simpara">Default normalization options</span>
    </dd>

   
  </dl>

 </p>
</div>





  <div class="section" id="normalizer.seealso">
   <h2 class="title">参见</h2>
   <p class="para">
    <ul class="simplelist">
     <li class="member">
      <a href="http://unicode.org/reports/tr15/" class="link external">&raquo;&nbsp;
       Unicode Normalization
      </a>
     </li>
     <li class="member">
      <a href="http://unicode.org/faq/normalization.html" class="link external">&raquo;&nbsp;
       Unicode Normalization FAQ
      </a>
     </li>
     <li class="member">
      <a href="http://www.icu-project.org/userguide/normalization.html" class="link external">&raquo;&nbsp;
       ICU User Guide - Normalization
      </a>
     </li>
     <li class="member">
      <a href="http://www.icu-project.org/apiref/icu4c/unorm_8h.html" class="link external">&raquo;&nbsp;
       ICU API Reference - Normalization
      </a>
     </li>
    </ul>
   </p>
  </div>
 </div>

 











<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="normalizer.isnormalized.html">Normalizer::isNormalized</a> — Checks if the provided string is already in the specified normalization
   form.</li><li><a href="normalizer.normalize.html">Normalizer::normalize</a> — Normalizes the input provided and returns the normalized string</li></ul>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="locale.setdefault.html">Locale::setDefault</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="normalizer.isnormalized.html">Normalizer::isNormalized</a></div>
 <div class="up"><a href="book.intl.html">intl</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
